<template>
  <div>
    <div v-if='show_tour'>
      <div class="prompt">还没有任何记录哦~</div>
    </div>
     <div v-else>

    
    <!-- <acollectlist
    :key='index' v-for='(strategy,index) in strategy' 
       :strategy = 'strategy' 
       >
       </acollectlist> -->
     </div>
  </div>
</template>

<script>
import {get} from '@/utli'
// import acollectlist from '../../components/acollectlist.vue';
   export default {
  components: {
  //  acollectlist
  },
 
        data(){
            return{
                strategy:[],
               astrategy:[],
               show_tour:false,
            }
        },
//传值        
methods:{
  async getsearch () {
    const data = {
      search: this.search,
    }
    const strategy = await get('/weapp/getsearch', data)
    this.strategy = strategy.strategy_mysql
    console.log("strategy从后台返回的记录数据：",this.strategy)
    console.log("search从后台返回的记录数据：",this.search)

    const astrategy = await get('/weapp/getasearch', data)
    this.astrategy = astrategy.astrategy_mysql
    console.log("astrategy从后台返回的记录数据：",this.astrategy)
    if(this.strategy.length === 0){
      this.show_tour = true
    }else{
      this.show_tour = false
    }
  }
   
},

  onShow () {
    const userinfo = wx.getStorageSync('userinfo')
    const search = wx.getStorageSync('search')
    //如果缓存中有userinfo的信息，说明用户登录了。
    if(userinfo.openId){
      //将用户信息储存到data的userinfo字段里面，this.userinfo就是指的这个字段。
      this.userinfo = userinfo
      this.search=search
    } 
    this.getsearch()
  },
    }
</script>

<style lang="scss">
    .searchHeader{
        width: 80%;
        height: 80rpx;
        margin: auto;
        border-bottom:1rpx solid  #f4ea2a;
        position: relative;
        input{
            height: 100%;
            width: 100%;
            .placeholder{
                // color:#f4ea2a ;
                text-align: center;
                font-size: 28rpx;
            }
        }
         .clear{
        position: absolute;
        right: 20rpx;
        top: 20rpx;
        z-index: 99;
    }
    }

   
</style>


